Skip to main content

Final Measurement Results

This endpoint is used by the frontend to retrieve final results of measurement session. It should be called only after the websocket session is closed. Frontend should provide accessToken parameter, which is sent by the backend in ACCESS_TOKEN message via websocket after websocket is opened.

After websocket session is closed, the backend starts to calculate final measurement results for this session. If this endpoint is called while backend in the calculation process, CALCULATION_IN_PROGRESS status will be returned (see below). If this endpoint is called when backend already calculated the results, the results are returned to the frontend and deleted from the backend (for security reasons). Therefore, if backend already returned measurement results by the specified accessToken, the second call of this endpoint with the same accessToken will result in the error (FINAL_MEASUREMENTS_RESULTS_NOT_FOUND).

Calculated measurements results are kept on the backend only for 1 minute after the calculation is completed (for security reasons). If frontend didn't call this endpoint during this time, the results are deleted from the backend and the call of this endpoint will result in error (FINAL_MEASUREMENTS_RESULTS_NOT_FOUND).

URL: ${BASE_URL}/v1/final_measurement_results?accessToken=${accessToken}

HTTP method: GET

Request URL parameters:

ParameterTypeRequiredDescription
accessTokenstringYAccess token received in websocket ACCESS_TOKEN message

HTTP response body:

Access token is not specified as the parameter the request URL:

{
"status": "fail",
"data": {
"failReason": "Access token is not specified",
"errorCode": "VALIDATION_ERROR_ACCESS_TOKEN_IS_EMPTY"
},
"message": null
}

Access token is invalid:

{
"status": "fail",
"data": {
"failReason": "Final measurements results are not found by specified access token",
"errorCode": "FINAL_MEASUREMENTS_RESULTS_NOT_FOUND"
},
"message": null
}

Websocket session is still opened for specified access token (this endpoint should be called only after corresponding websocket session is closed):

{
"status": "success",
"data": {
"resultsStatus": "SESSION_IN_PROGRESS",
"data": null
},
"message": null
}

Backend is still in the process of final results calculation (it can take up to couple of seconds) -> frontend should try to call this endpoint again in 200-300 ms:

{
"status": "success",
"data": {
"resultsStatus": "CALCULATION_IN_PROGRESS",
"data": null
},
"message": null
}

Some error occurred on backend during the calculation of final results:

{
"status": "success",
"data": {
"resultsStatus": "CALCULATION_ERROR",
"data": null
},
"message": null
}

Final results were calculated successfully:

{
"status": "success",
"data": {
"resultsStatus": "CALCULATED",
"data": {
"bpm": 147,
"rr": 18,
"oxygen": 97,
"stressStatus": "NORMAL",
"bloodPressureStatus": "NORMAL",
"bloodPressure": {
"systolic": 102,
"diastolic": 48
}
}
},
"message": null
}
FieldTypeDescription
bpmintegerMean value of heartbeat BPM; if 0, the value can't be calculated
rrintegerMean value of respiration rate; if 0, the value can't be calculated
oxygenintegerMean value of oxygen; if 0, the value can't be calculated
bloodPressureStatusstringMean value of blood pressure status; possible values are described in Measurement Data section
bloodPressureobjectStructure containing blood pressure values
systolicintegerSystolic blood pressure; if -1, the value can't be calculated
diastolicintegerDiastolic blood pressure; if -1, the value can't be calculated